package com.xuexiang.xuidemo.slice.status;

import com.xuexiang.xui_lib.component.TitleBarLayout;
import com.xuexiang.xui_lib.component.status.StatusLoader;
import com.xuexiang.xuidemo.ResourceTable;
import com.xuexiang.xuidemo.slice.BaseAbilitySlice;
import com.xuexiang.xuidemo.slice.status.adapter.DefaultStatusAdapter;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;
import ohos.agp.components.Text;

/**
 *
 */
public class StatusLoaderSlice extends BaseAbilitySlice {

    @Override
    protected int getTitleBarId() {
        return ResourceTable.Id_title_bar;
    }

    @Override
    protected int getUIContentLayoutId() {
        return ResourceTable.Layout_ability_slice_status_loader;
    }

    @Override
    protected void initComponents() {
        super.initComponents();
        StatusLoader.initDefault(new DefaultStatusAdapter());
        findComponentById(ResourceTable.Id_tv_1).setClickedListener(component -> {
            present(new StatusLoaderMultiplesSlice(),new Intent());
        });
        findComponentById(ResourceTable.Id_tv_2).setClickedListener(component -> {
            present(new StatusLoaderSingleSlice(),new Intent());
        });
    }
}
